﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="Plugin" table="cmsPlugin" discriminator-value="false">
    <cache usage="read-write" />
    <id name="ID" unsaved-value="0" column="ID" type="System.Int32">
      <generator class="identity" />
    </id>
    <discriminator column="Templatable" type="System.Boolean" />
    <property name="FullClassName" column="ClassName" not-null="true" type="System.String" />
    <property name="AssemblyName" column="AssemblyName" not-null="true" type="System.String" />
    <property name="Activated" column="Activated" not-null="true" type="System.Boolean" />
    <subclass name="TemplatablePlugin" discriminator-value="true">
      <bag name="Templates" cascade="all-delete-orphan" table="cmsPluginTemplate" inverse="true">
        <cache usage="read-write" />
        <key column="PluginID" />
        <one-to-many class="PluginTemplate" />
      </bag>
    </subclass>
  </class>
</hibernate-mapping>